package com.chenyx.space.data.config.storage;

import com.aliyun.oss.OSSClient;
import com.chenyx.space.data.properties.AliOSSProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by rize on 2019/4/26.
 */
@Configuration
public class OSSClientConfig {

    @Autowired
    private AliOSSProperties aliOSSProperties;

    @Bean
    public OSSClient ossClient() {
        return new OSSClient(aliOSSProperties.getEndpoint(), aliOSSProperties.getAccessKeyId(), aliOSSProperties.getAccessKeySecret());
    }

}
